package com.imooc.springboot.dubbo.consumer;

import com.alibaba.dubbo.spring.boot.annotation.EnableDubboConfiguration;
import com.imooc.springboot.dubbo.consumer.quickstart.QuickstartConsumer;
import com.imooc.springboot.dubbo.consumer.transaction.TransactionConsumer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.Arrays;

@SpringBootApplication
@EnableDubboConfiguration
public class ConsumerApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(ConsumerApplication.class, args);
//        QuickstartConsumer quickstartConsumer = run.getBean("quickstartConsumer", QuickstartConsumer.class);
//        System.out.println("==================================================");
//        quickstartConsumer.sendMessage("hello dubbo");

        TransactionConsumer transactionConsumer = run.getBean("transactionConsumer", TransactionConsumer.class);
        System.out.println("====================================================================================");
//        transactionConsumer.sendMessage("hello Transaction!");
        transactionConsumer.sendMessage("4,5");
        // 1,2,3  4,5

    }

}
